<?php
require_once '../db.php';
require_once '../lib.php';

$title = mysql_real_escape_string($_POST['title']);
$link = mysql_real_escape_string($_POST['link']);
$col = (int) $_POST['col'];
$image = file_get_contents($_FILES['image']['tmp_name']);
//$image = mysql_real_escape_string(resizeImage($image, 200, 200));
$image = mysql_real_escape_string($image);
$content = mysql_real_escape_string($_POST['content']);

$res = mysql_query("insert into blog(title, link, col, image, content) values('$title', '$link', $col, '$image', '$content')");
if(!$res){
	echo mysql_error();
}
